﻿using System;
using System.Collections.Generic;
using Colorful.Furniture.IEntity;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.ErpInventoryManagement;

/// <summary>
///  库存产品分类
/// </summary>
[Table(Name = "erp_bbs_inventory_category")]
public class InventoryCategory : AuditSoftDeleteAggregateRoot
{
    /// <summary>
    ///  编码
    /// </summary>
    [Column(Name = "id")]
    public Guid? Id { get; set; }

    /// <summary>
    ///  名字
    /// </summary>
    [Column(Name = "name", StringLength = 50)]
    public string Name { get; set; }

    /// <summary>
    ///  父级编码
    /// </summary>
    [Column(Name = "parent_id")]
    public Guid? ParentId { get; set; }

    /// <summary>
    ///  排序
    /// </summary>
    [Column(Name = "sort")]
    public int Sort { get; set; }

    /// <summary>
    ///  代码
    /// </summary>
    [Column(Name = "code", StringLength = 50, IsIdentity = true)]
    public string Code { get; set; }

    /// <summary>
    ///  父级
    /// </summary>
    public InventoryCategory Parent { get; set; }

    /// <summary>
    ///  子集
    /// </summary>
    public List<InventoryCategory> Children { get; set; }
}